<html>
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <meta http-equiv="Cache-Control" content="max-age=10"/>  
      <title>测试头信息</title>
    </head>
    <body>
       <input type="button" value="测试缓存" onclick="cache_control();" >
    </body>
    <script type="text/javascript" src="http://localhost:8080/springmvc/js/jquery-1.12.1.min.js"></script>
    <script>
    function cache_control(){
    	 $.ajax({
         	url:"http://localhost:8080/springmvc/testHttp/testGet.do",
         	type:"get",
         	dataType:"text",
         	async:false,
         	cache:true,
         	data:{age:120},
         	beforeSend: function (request) {
         		request.setRequestHeader("Cache-Control", "max-age=20");
            },
         	success:function(json){
         		alert(json);
         	}
         });
    }
    </script>
</html>